/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.bridge;

import java.util.Iterator;
import java.util.List;

/**
 *
 * @author Rakev
 */
public class IteratorBridge<E, B extends JSkyBridge<E>> extends JSkyBridge<Iterator<E>> implements Iterator<B> {

    public IteratorBridge(Iterator<E> adapting) {
        super(adapting);
    }

    @Override
    public boolean hasNext() {
        return getRawObject().hasNext();
    }

    @Override
    public B next() {
        E nextElement = getRawObject().next();
        return (B) getBridgeFactory().createBridge(nextElement);
    }

    @Override
    public void remove() {
        getRawObject().remove();
    }
    
}
